package csharp.cauth.properties;

import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;

/**
 * @author Ярослав (CSharp) Inventory property for authorization.
 */
public class InventoryProp
{
	private ItemStack[] items;
	private ItemStack helmet;
	private ItemStack chest;
	private ItemStack leggings;
	private ItemStack boots;

	public InventoryProp(PlayerInventory inv)
	{
		super();
		this.items = inv.getContents();

		// Some problems with getArmorContents();
		this.helmet = inv.getHelmet();
		this.chest = inv.getChestplate();
		this.leggings = inv.getLeggings();
		this.boots = inv.getBoots();
	}

	public ItemStack[] getItems()
	{
		return items;
	}

	public void setItems(ItemStack[] items)
	{
		this.items = items;
	}

	public ItemStack getHelmet()
	{
		if (helmet.getType() != Material.AIR)
			return helmet;
		else
			return null;
	}

	public void setHelmet(ItemStack helmet)
	{
		this.helmet = helmet;
	}

	public ItemStack getChest()
	{
		if (chest.getType() != Material.AIR)
			return chest;
		else
			return null;
	}

	public void setChest(ItemStack chest)
	{
		this.chest = chest;
	}

	public ItemStack getLeggings()
	{
		if (leggings.getType() != Material.AIR)
			return leggings;
		else
			return null;
	}

	public void setLeggings(ItemStack leggings)
	{
		this.leggings = leggings;
	}

	public ItemStack getBoots()
	{
		if (boots.getType() != Material.AIR)
			return boots;
		else
			return null;
	}

	public void setBoots(ItemStack boots)
	{
		this.boots = boots;
	}
}
